//======================================================================
//    We will gone,the word kept   (license)
//======================================================================
//    version & features log
//======================================================================
 module pfifo_axis
  #(parameter DW = 16,
   parameter AW = 10,
   parameter UW = 4 ,
   parameter PROG_EMPTY = 4,
   parameter PROG_FULL = 2**AW-128,
   parameter RATIO_WIDTH = 0,
   parameter ASY_CLK_ENB = "TRUE")
 (
 input          m_aclk                 ,                       
 input          s_aclk                 ,
 input          m_aresetn              ,   
 input          s_aresetn              ,      
 input          s_axis_tvalid          ,          
 output         s_axis_tready          ,          
 input [DW-1:0] s_axis_tdata           ,          
 input          s_axis_tlast           ,          
 input [UW-1:0] s_axis_tuser           ,          
 output          m_axis_tvalid          ,  //word valid,but no packet valid        
 input           m_axis_tready         ,          
 output [DW-1:0] m_axis_tdata          ,          
 output          m_axis_tlast          ,          
 output [UW-1:0] m_axis_tuser          , 
 output          axis_almost_full       ,
 output          axis_almost_empty      ,         
 output [AW : 0] axis_wr_data_count    ,                  
 output [AW : 0] axis_rd_data_count    ,
 output [AW-1:0] axis_pkt_count        ,                  
 output          axis_pkt_empty        //can & m_axis_valid become a new axis_valid
 );

pfifo_pktcnt
  #(.PKT_WIDTH (AW ) ,
   .RATIO_WIDTH (RATIO_WIDTH),
   .ASY_CLK_ENB ("TRUE")
  ) u_pktcnt
 (
 .m_aclk            (m_aclk )        ,                       
 .s_aclk            (s_aclk )        ,  
 .m_aresetn         (m_aresetn )     ,
 .s_aresetn         (s_aresetn )     ,       
 .s_axis_tvalid     (s_axis_tvalid )     ,          
 .s_axis_tready     (s_axis_tready )     ,   
 .s_axis_tlast      (s_axis_tlast )      ,         
 .m_axis_tvalid     (m_axis_tvalid )     ,          
 .m_axis_tready     (m_axis_tready )     ,        
 .m_axis_tlast      (m_axis_tlast )      ,          
 .m_pkt_count       (axis_pkt_count )    ,                  
 .m_pkt_empty       (axis_pkt_empty )
 );

  fifo_axis
  #( .DW ( DW ),
     .AW ( AW ),
     .UW ( UW ),
     .PROG_EMPTY     (PROG_EMPTY) ,
     .PROG_FULL      (PROG_FULL),
     .ASY_CLK_ENB    (ASY_CLK_ENB) ) u_fifo
 (
 .m_aclk                 ( m_aclk             )  ,                       
 .s_aclk                 ( s_aclk             )  ,  
 .s_aresetn              ( s_aresetn          )  ,      
 .s_axis_tvalid          ( s_axis_tvalid      )  ,          
 .s_axis_tready          ( s_axis_tready      )  ,          
 .s_axis_tdata           ( s_axis_tdata       )  ,          
 .s_axis_tlast           ( s_axis_tlast       )  ,          
 .s_axis_tuser           ( s_axis_tuser       )  ,          
 .m_axis_tvalid          ( m_axis_tvalid      )  ,          
 .m_axis_tready          ( m_axis_tready      ) ,          
 .m_axis_tdata           ( m_axis_tdata       ) ,          
 .m_axis_tlast           ( m_axis_tlast       ) ,          
 .m_axis_tuser           ( m_axis_tuser       ) , 
 .axis_almost_full       ( axis_almost_full   )  ,
 .axis_almost_empty      ( axis_almost_empty  )  ,         
 .axis_wr_data_count     ( axis_wr_data_count ) ,                  
 .axis_rd_data_count     ( axis_rd_data_count )
 );


 endmodule

